package com.guanyu.u2cache.util;

/**
 * Description key工具类
 *
 * @author zgy
 * Date 2021/6/15
 */
public class KeyUtil {


    /**
     * 逗号分隔符
     **/
    public static final String SPLIT = "-";

    /**
     * 公共方法包装key
     ***/
    public static String createKey(Object... keys) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < keys.length; i++) {
            if (i < keys.length - 1) {
                stringBuilder.append(keys[i]).append(SPLIT);
            } else {
                stringBuilder.append(keys[i]);
            }
        }
        return stringBuilder.toString();
    }


}
